package com.drug.wms.service.impl;

import java.util.List;

import com.drug.common.enums.BusinessSeqEnum;
import com.drug.common.utils.DateUtils;
import com.drug.wms.service.GenerateSequence;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.drug.wms.mapper.BusGoodsCategoryInfoMapper;
import com.drug.wms.domain.BusGoodsCategoryInfo;
import com.drug.wms.service.IBusGoodsCategoryInfoService;

/**
 * 商品类别信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-11-12
 */
@Service
public class BusGoodsCategoryInfoServiceImpl implements IBusGoodsCategoryInfoService 
{
    @Autowired
    private BusGoodsCategoryInfoMapper busGoodsCategoryInfoMapper;

    /**
     * 查询商品类别信息
     * 
     * @param id 商品类别信息主键
     * @return 商品类别信息
     */
    @Override
    public BusGoodsCategoryInfo selectBusGoodsCategoryInfoById(String id)
    {
        return busGoodsCategoryInfoMapper.selectBusGoodsCategoryInfoById(id);
    }

    /**
     * 查询商品类别信息列表
     * 
     * @param busGoodsCategoryInfo 商品类别信息
     * @return 商品类别信息
     */
    @Override
    public List<BusGoodsCategoryInfo> selectBusGoodsCategoryInfoList(BusGoodsCategoryInfo busGoodsCategoryInfo)
    {
        return busGoodsCategoryInfoMapper.selectBusGoodsCategoryInfoList(busGoodsCategoryInfo);
    }

    /**
     * 新增商品类别信息
     * 
     * @param busGoodsCategoryInfo 商品类别信息
     * @return 结果
     */
    @Override
    public int insertBusGoodsCategoryInfo(BusGoodsCategoryInfo busGoodsCategoryInfo)
    {
        busGoodsCategoryInfo.setCategoryNo(GenerateSequence.genSeqNo(BusinessSeqEnum.SL.getCode()));
        busGoodsCategoryInfo.setCreateTime(DateUtils.getNowDate());
        return busGoodsCategoryInfoMapper.insertBusGoodsCategoryInfo(busGoodsCategoryInfo);
    }

    /**
     * 修改商品类别信息
     * 
     * @param busGoodsCategoryInfo 商品类别信息
     * @return 结果
     */
    @Override
    public int updateBusGoodsCategoryInfo(BusGoodsCategoryInfo busGoodsCategoryInfo)
    {
        busGoodsCategoryInfo.setUpdateTime(DateUtils.getNowDate());
        return busGoodsCategoryInfoMapper.updateBusGoodsCategoryInfo(busGoodsCategoryInfo);
    }

    /**
     * 批量删除商品类别信息
     * 
     * @param ids 需要删除的商品类别信息主键
     * @return 结果
     */
    @Override
    public int deleteBusGoodsCategoryInfoByIds(String[] ids)
    {
        return busGoodsCategoryInfoMapper.deleteBusGoodsCategoryInfoByIds(ids);
    }

    /**
     * 删除商品类别信息信息
     * 
     * @param id 商品类别信息主键
     * @return 结果
     */
    @Override
    public int deleteBusGoodsCategoryInfoById(String id)
    {
        return busGoodsCategoryInfoMapper.deleteBusGoodsCategoryInfoById(id);
    }
}
